package main

import (
	"fmt"
	"time"
)

func main1() {
	// 创建一个无缓冲 channel
	ch := make(chan string)

	// 启动一个 goroutine 来发送数据
	go func() {
		fmt.Println("Sending data to channel...")
		time.Sleep(10 * time.Second)
		ch <- "Hello, Go!"
		fmt.Println("Data sent to channel.")
	}()

	//// 在主 goroutine 中接收数据
	fmt.Println("Waiting to receive data from channel...")
	message := <-ch
	fmt.Println("Received data:", message)
}
